package com.hotel.service;

import com.hotel.entity.PageBean;
import com.hotel.entity.User;
import com.hotel.exception.EntityException;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface UserService {
    // 获取所有用户信息
    List<User> getUsers() throws SQLException;

    // 根据前端设置的条件获取用户
    PageBean<User> getUserList(Map<String, Object> map) throws SQLException;

    // 获取一个用户
    User getUserById(String id) throws SQLException;

    // 登录检查
    User doLogin(String username, String password) throws SQLException, EntityException;

    // 添加用户
    String addUser(User user) throws SQLException;

    // 修改用户
    String updateUser(User user) throws SQLException;

    // 删除用户
    void deleteUser(String id) throws SQLException, EntityException;

    // 新增或更新用户
    void saveUser(User user) throws SQLException, EntityException;
}
